package com.cml.dm.admin.service;

import com.cml.dm.admin.service.impl.DmContextMetaInitService;
import com.cml.dm.admin.service.impl.DmContextSQLInitService;
import com.cml.dm.engine.enums.DmEngineInitEnums;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class DmContextInitServiceFactory {
    @Resource
    private DmContextMetaInitService dmContextMetaInitService;
    @Resource
    private DmContextSQLInitService dmContextSQLInitService;

    public DmContextInitService getDmContextInitService(String type){
        if(DmEngineInitEnums.SQL_INIT.getType().equals(type)){
            return  dmContextSQLInitService;
        }else if(DmEngineInitEnums.META_HANDLER.getType().equals(type)){
            return dmContextMetaInitService;
        }
        return null;
    }
}
